function [iv,ki,order] = interp3c(mns,vol,TOLER)
%% ----------------------description-----------------------------
%Interpolated implied volatilities using the spaps MATLAB command
%Inputs:
%mns: Moneyness level (calculated as K/S, where K = strike price, S = stock
%price
%vol: Implied volatility
%TOLER: Tolerance level
%Outputs:
%iv: Interpolated implied volatilities
%ki: Moneyness level grid points
%order: The order of the poynomial function
%% ---------------------------------------------------------------
step=(max(mns)-min(mns))/1000;
ki=[min(mns):step:max(mns)]';
[sp,~,~]=spaps(mns,vol,TOLER,3);
order=sp.order;
iv = fnval(sp,ki);
end